<template>
    <div class="wrapper">
        <swiper :options="swiperOption">
            <swiper-slide v-for="item of swiperList" :key="item.id">
                <img :src="item.imgUrl" alt="" class="swiper-img">
            </swiper-slide>
            <div class="swiper-pagination" slot="pagination"></div>
        </swiper>
    </div>
</template>

<script>
    export default {
        name: "HomeSwiper",
        data() {
            return {
                swiperOption: {
                    pagination:'.swiper-pagination',
                    loop:true
                },
                swiperList:[
                    {
                        id:'0001',
                        imgUrl:'https://imgs.qunarzz.com/sight/p0/1505/d2/d274c92de14c93da.water.jpg_350x240_06a0b57d.jpg'
                    },
                    {
                        id:'0002',
                        imgUrl:'https://imgs.qunarzz.com/sight/p0/1910/21/2155967acb775f3ba3.img.jpg_350x240_84585846.jpg'
                    }
                ]
            }
        }
    }
</script>

<style lang="stylus" scoped>
    .wrapper >>> .swiper-pagination-bullet-active
        background-color #fff
    .wrapper
        overflow hidden
        width 100%
        height 0
        padding-bottom 68.57%
        /*宽度相对于高度为68.57%  固定宽高*/
        background-color #eee
        .swiper-img
            width 100%
</style>